3.13.26 \(\int \frac {a+b \tan (e+f x)}{(c+d \tan (e+f x))^3} \, dx\) [1226]

Optimal. Leaf size=177 \[ \frac {\left (a c^3+3 b c^2 d-3 a c d^2-b d^3\right ) x}{\left (c^2+d^2\right )^3}+\frac {\left (a d \left (3 c^2-d^2\right )-b \left (c^3-3 c d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{\left (c^2+d^2\right )^3 f}+\frac {b c-a d}{2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}-\frac {2 a c d-b \left (c^2-d^2\right )}{\left (c^2+d^2\right )^2 f (c+d \tan (e+f x))} \]

[Out]

(a*c^3-3*a*c*d^2+3*b*c^2*d-b*d^3)*x/(c^2+d^2)^3+(a*d*(3*c^2-d^2)-b*(c^3-3*c*d^2))*ln(c*cos(f*x+e)+d*sin(f*x+e)
)/(c^2+d^2)^3/f+1/2*(-a*d+b*c)/(c^2+d^2)/f/(c+d*tan(f*x+e))^2+(-2*a*c*d+b*(c^2-d^2))/(c^2+d^2)^2/f/(c+d*tan(f*
x+e))

________________________________________________________________________________________

Rubi [A]
time = 0.20, antiderivative size = 177, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3610, 3612, 3611} \begin {gather*} \frac {b c-a d}{2 f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}-\frac {2 a c d-b \left (c^2-d^2\right )}{f \left (c^2+d^2\right )^2 (c+d \tan (e+f x))}+\frac {\left (a d \left (3 c^2-d^2\right )-b \left (c^3-3 c d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )^3}+\frac {x \left (a c^3-3 a c d^2+3 b c^2 d-b d^3\right )}{\left (c^2+d^2\right )^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*Tan[e + f*x])/(c + d*Tan[e + f*x])^3,x]

[Out]

((a*c^3 + 3*b*c^2*d - 3*a*c*d^2 - b*d^3)*x)/(c^2 + d^2)^3 + ((a*d*(3*c^2 - d^2) - b*(c^3 - 3*c*d^2))*Log[c*Cos
[e + f*x] + d*Sin[e + f*x]])/((c^2 + d^2)^3*f) + (b*c - a*d)/(2*(c^2 + d^2)*f*(c + d*Tan[e + f*x])^2) - (2*a*c
*d - b*(c^2 - d^2))/((c^2 + d^2)^2*f*(c + d*Tan[e + f*x]))

Rule 3610

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b
*c - a*d)*((a + b*Tan[e + f*x])^(m + 1)/(f*(m + 1)*(a^2 + b^2))), x] + Dist[1/(a^2 + b^2), Int[(a + b*Tan[e +
f*x])^(m + 1)*Simp[a*c + b*d - (b*c - a*d)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c
 - a*d, 0] && NeQ[a^2 + b^2, 0] && LtQ[m, -1]

Rule 3611

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c/(b*f))
*Log[RemoveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

Rule 3612

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c +
b*d)*(x/(a^2 + b^2)), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rubi steps

\begin {align*} \int \frac {a+b \tan (e+f x)}{(c+d \tan (e+f x))^3} \, dx &=\frac {b c-a d}{2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {\int \frac {a c+b d+(b c-a d) \tan (e+f x)}{(c+d \tan (e+f x))^2} \, dx}{c^2+d^2}\\ &=\frac {b c-a d}{2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}-\frac {2 a c d-b \left (c^2-d^2\right )}{\left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}+\frac {\int \frac {2 b c d+a \left (c^2-d^2\right )-\left (2 a c d-b \left (c^2-d^2\right )\right ) \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{\left (c^2+d^2\right )^2}\\ &=\frac {\left (a c^3+3 b c^2 d-3 a c d^2-b d^3\right ) x}{\left (c^2+d^2\right )^3}+\frac {b c-a d}{2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}-\frac {2 a c d-b \left (c^2-d^2\right )}{\left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}+\frac {\left (d \left (2 b c d+a \left (c^2-d^2\right )\right )-c \left (-2 a c d+b \left (c^2-d^2\right )\right )\right ) \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{\left (c^2+d^2\right )^3}\\ &=\frac {\left (a c^3+3 b c^2 d-3 a c d^2-b d^3\right ) x}{\left (c^2+d^2\right )^3}+\frac {\left (a d \left (3 c^2-d^2\right )-b \left (c^3-3 c d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{\left (c^2+d^2\right )^3 f}+\frac {b c-a d}{2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}-\frac {2 a c d-b \left (c^2-d^2\right )}{\left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 4.52, size = 244, normalized size = 1.38 \begin {gather*} \frac {-b \left (\frac {i \log (i-\tan (e+f x))}{(c+i d)^2}-\frac {i \log (i+\tan (e+f x))}{(c-i d)^2}+\frac {2 d \left (-2 c \log (c+d \tan (e+f x))+\frac {c^2+d^2}{c+d \tan (e+f x)}\right )}{\left (c^2+d^2\right )^2}\right )+(b c-a d) \left (\frac {i \log (i-\tan (e+f x))}{(c+i d)^3}-\frac {\log (i+\tan (e+f x))}{(i c+d)^3}+\frac {d \left (\left (-6 c^2+2 d^2\right ) \log (c+d \tan (e+f x))+\frac {\left (c^2+d^2\right ) \left (5 c^2+d^2+4 c d \tan (e+f x)\right )}{(c+d \tan (e+f x))^2}\right )}{\left (c^2+d^2\right )^3}\right )}{2 d f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Tan[e + f*x])/(c + d*Tan[e + f*x])^3,x]

[Out]

(-(b*((I*Log[I - Tan[e + f*x]])/(c + I*d)^2 - (I*Log[I + Tan[e + f*x]])/(c - I*d)^2 + (2*d*(-2*c*Log[c + d*Tan
[e + f*x]] + (c^2 + d^2)/(c + d*Tan[e + f*x])))/(c^2 + d^2)^2)) + (b*c - a*d)*((I*Log[I - Tan[e + f*x]])/(c +
I*d)^3 - Log[I + Tan[e + f*x]]/(I*c + d)^3 + (d*((-6*c^2 + 2*d^2)*Log[c + d*Tan[e + f*x]] + ((c^2 + d^2)*(5*c^
2 + d^2 + 4*c*d*Tan[e + f*x]))/(c + d*Tan[e + f*x])^2))/(c^2 + d^2)^3))/(2*d*f)

________________________________________________________________________________________

Maple [A]
time = 0.28, size = 208, normalized size = 1.18

method result size
derivativedivides \(\frac {\frac {\left (3 a \,c^{2} d -a \,d^{3}-b \,c^{3}+3 b c \,d^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3}}-\frac {a d -b c}{2 \left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )^{2}}-\frac {2 a c d -b \,c^{2}+b \,d^{2}}{\left (c^{2}+d^{2}\right )^{2} \left (c +d \tan \left (f x +e \right )\right )}+\frac {\frac {\left (-3 a \,c^{2} d +a \,d^{3}+b \,c^{3}-3 b c \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a \,c^{3}-3 a c \,d^{2}+3 b \,c^{2} d -b \,d^{3}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3}}}{f}\) \(208\)
default \(\frac {\frac {\left (3 a \,c^{2} d -a \,d^{3}-b \,c^{3}+3 b c \,d^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3}}-\frac {a d -b c}{2 \left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )^{2}}-\frac {2 a c d -b \,c^{2}+b \,d^{2}}{\left (c^{2}+d^{2}\right )^{2} \left (c +d \tan \left (f x +e \right )\right )}+\frac {\frac {\left (-3 a \,c^{2} d +a \,d^{3}+b \,c^{3}-3 b c \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a \,c^{3}-3 a c \,d^{2}+3 b \,c^{2} d -b \,d^{3}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3}}}{f}\) \(208\)
norman \(\frac {\frac {\left (a \,c^{3}-3 a c \,d^{2}+3 b \,c^{2} d -b \,d^{3}\right ) c^{2} x}{\left (c^{4}+2 c^{2} d^{2}+d^{4}\right ) \left (c^{2}+d^{2}\right )}+\frac {d^{2} \left (a \,c^{3}-3 a c \,d^{2}+3 b \,c^{2} d -b \,d^{3}\right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{\left (c^{4}+2 c^{2} d^{2}+d^{4}\right ) \left (c^{2}+d^{2}\right )}-\frac {3 a \,c^{2} d^{2}+a \,d^{4}-2 b \,c^{3} d}{2 d f \left (c^{4}+2 c^{2} d^{2}+d^{4}\right )}+\frac {d \left (2 a c \,d^{2}-b \,c^{2} d +b \,d^{3}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 f c \left (c^{4}+2 c^{2} d^{2}+d^{4}\right )}+\frac {2 d \left (a \,c^{3}-3 a c \,d^{2}+3 b \,c^{2} d -b \,d^{3}\right ) c x \tan \left (f x +e \right )}{\left (c^{4}+2 c^{2} d^{2}+d^{4}\right ) \left (c^{2}+d^{2}\right )}}{\left (c +d \tan \left (f x +e \right )\right )^{2}}+\frac {\left (3 a \,c^{2} d -a \,d^{3}-b \,c^{3}+3 b c \,d^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{f \left (c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}\right )}-\frac {\left (3 a \,c^{2} d -a \,d^{3}-b \,c^{3}+3 b c \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}\right )}\) \(437\)
risch \(\frac {i x b}{3 i c^{2} d -i d^{3}-c^{3}+3 c \,d^{2}}-\frac {a x}{3 i c^{2} d -i d^{3}-c^{3}+3 c \,d^{2}}-\frac {6 i a \,c^{2} d x}{c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}}+\frac {2 i a \,d^{3} x}{c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}}+\frac {2 i b \,c^{3} x}{c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}}-\frac {6 i b c \,d^{2} x}{c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}}-\frac {6 i a \,c^{2} d e}{f \left (c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}\right )}+\frac {2 i a \,d^{3} e}{f \left (c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}\right )}+\frac {2 i b \,c^{3} e}{f \left (c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}\right )}-\frac {6 i b c \,d^{2} e}{f \left (c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}\right )}-\frac {2 i \left (2 i a c \,d^{3} {\mathrm e}^{2 i \left (f x +e \right )}-i b \,c^{2} d^{2} {\mathrm e}^{2 i \left (f x +e \right )}-a \,d^{4} {\mathrm e}^{2 i \left (f x +e \right )}-3 i a c \,d^{3}+2 i b \,c^{2} d^{2}-b c \,d^{3}+i b \,d^{4} {\mathrm e}^{2 i \left (f x +e \right )}-3 a \,c^{2} d^{2} {\mathrm e}^{2 i \left (f x +e \right )}+2 b \,c^{3} d \,{\mathrm e}^{2 i \left (f x +e \right )}-i b \,d^{4}-3 a \,c^{2} d^{2}+2 b \,c^{3} d \right )}{\left (i d +c \right )^{2} \left (-i {\mathrm e}^{2 i \left (f x +e \right )} d +i d +{\mathrm e}^{2 i \left (f x +e \right )} c +c \right )^{2} f \left (-i d +c \right )^{3}}+\frac {3 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) a \,c^{2} d}{f \left (c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) a \,d^{3}}{f \left (c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) b \,c^{3}}{f \left (c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}\right )}+\frac {3 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) b c \,d^{2}}{f \left (c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}\right )}\) \(803\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*tan(f*x+e))/(c+d*tan(f*x+e))^3,x,method=_RETURNVERBOSE)

[Out]

1/f*((3*a*c^2*d-a*d^3-b*c^3+3*b*c*d^2)/(c^2+d^2)^3*ln(c+d*tan(f*x+e))-1/2*(a*d-b*c)/(c^2+d^2)/(c+d*tan(f*x+e))
^2-(2*a*c*d-b*c^2+b*d^2)/(c^2+d^2)^2/(c+d*tan(f*x+e))+1/(c^2+d^2)^3*(1/2*(-3*a*c^2*d+a*d^3+b*c^3-3*b*c*d^2)*ln
(1+tan(f*x+e)^2)+(a*c^3-3*a*c*d^2+3*b*c^2*d-b*d^3)*arctan(tan(f*x+e))))

________________________________________________________________________________________

Maxima [A]
time = 0.67, size = 327, normalized size = 1.85 \begin {gather*} \frac {\frac {2 \, {\left (a c^{3} + 3 \, b c^{2} d - 3 \, a c d^{2} - b d^{3}\right )} {\left (f x + e\right )}}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} - \frac {2 \, {\left (b c^{3} - 3 \, a c^{2} d - 3 \, b c d^{2} + a d^{3}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac {{\left (b c^{3} - 3 \, a c^{2} d - 3 \, b c d^{2} + a d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac {3 \, b c^{3} - 5 \, a c^{2} d - b c d^{2} - a d^{3} + 2 \, {\left (b c^{2} d - 2 \, a c d^{2} - b d^{3}\right )} \tan \left (f x + e\right )}{c^{6} + 2 \, c^{4} d^{2} + c^{2} d^{4} + {\left (c^{4} d^{2} + 2 \, c^{2} d^{4} + d^{6}\right )} \tan \left (f x + e\right )^{2} + 2 \, {\left (c^{5} d + 2 \, c^{3} d^{3} + c d^{5}\right )} \tan \left (f x + e\right )}}{2 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))/(c+d*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

1/2*(2*(a*c^3 + 3*b*c^2*d - 3*a*c*d^2 - b*d^3)*(f*x + e)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) - 2*(b*c^3 - 3*a*
c^2*d - 3*b*c*d^2 + a*d^3)*log(d*tan(f*x + e) + c)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) + (b*c^3 - 3*a*c^2*d -
3*b*c*d^2 + a*d^3)*log(tan(f*x + e)^2 + 1)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) + (3*b*c^3 - 5*a*c^2*d - b*c*d^
2 - a*d^3 + 2*(b*c^2*d - 2*a*c*d^2 - b*d^3)*tan(f*x + e))/(c^6 + 2*c^4*d^2 + c^2*d^4 + (c^4*d^2 + 2*c^2*d^4 +
d^6)*tan(f*x + e)^2 + 2*(c^5*d + 2*c^3*d^3 + c*d^5)*tan(f*x + e)))/f

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 491 vs. \(2 (179) = 358\).
time = 1.06, size = 491, normalized size = 2.77 \begin {gather*} \frac {5 \, b c^{3} d^{2} - 7 \, a c^{2} d^{3} - b c d^{4} - a d^{5} + 2 \, {\left (a c^{5} + 3 \, b c^{4} d - 3 \, a c^{3} d^{2} - b c^{2} d^{3}\right )} f x - {\left (3 \, b c^{3} d^{2} - 5 \, a c^{2} d^{3} - 3 \, b c d^{4} + a d^{5} - 2 \, {\left (a c^{3} d^{2} + 3 \, b c^{2} d^{3} - 3 \, a c d^{4} - b d^{5}\right )} f x\right )} \tan \left (f x + e\right )^{2} - {\left (b c^{5} - 3 \, a c^{4} d - 3 \, b c^{3} d^{2} + a c^{2} d^{3} + {\left (b c^{3} d^{2} - 3 \, a c^{2} d^{3} - 3 \, b c d^{4} + a d^{5}\right )} \tan \left (f x + e\right )^{2} + 2 \, {\left (b c^{4} d - 3 \, a c^{3} d^{2} - 3 \, b c^{2} d^{3} + a c d^{4}\right )} \tan \left (f x + e\right )\right )} \log \left (\frac {d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \, {\left (2 \, b c^{4} d - 3 \, a c^{3} d^{2} - 3 \, b c^{2} d^{3} + 3 \, a c d^{4} + b d^{5} - 2 \, {\left (a c^{4} d + 3 \, b c^{3} d^{2} - 3 \, a c^{2} d^{3} - b c d^{4}\right )} f x\right )} \tan \left (f x + e\right )}{2 \, {\left ({\left (c^{6} d^{2} + 3 \, c^{4} d^{4} + 3 \, c^{2} d^{6} + d^{8}\right )} f \tan \left (f x + e\right )^{2} + 2 \, {\left (c^{7} d + 3 \, c^{5} d^{3} + 3 \, c^{3} d^{5} + c d^{7}\right )} f \tan \left (f x + e\right ) + {\left (c^{8} + 3 \, c^{6} d^{2} + 3 \, c^{4} d^{4} + c^{2} d^{6}\right )} f\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))/(c+d*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

1/2*(5*b*c^3*d^2 - 7*a*c^2*d^3 - b*c*d^4 - a*d^5 + 2*(a*c^5 + 3*b*c^4*d - 3*a*c^3*d^2 - b*c^2*d^3)*f*x - (3*b*
c^3*d^2 - 5*a*c^2*d^3 - 3*b*c*d^4 + a*d^5 - 2*(a*c^3*d^2 + 3*b*c^2*d^3 - 3*a*c*d^4 - b*d^5)*f*x)*tan(f*x + e)^
2 - (b*c^5 - 3*a*c^4*d - 3*b*c^3*d^2 + a*c^2*d^3 + (b*c^3*d^2 - 3*a*c^2*d^3 - 3*b*c*d^4 + a*d^5)*tan(f*x + e)^
2 + 2*(b*c^4*d - 3*a*c^3*d^2 - 3*b*c^2*d^3 + a*c*d^4)*tan(f*x + e))*log((d^2*tan(f*x + e)^2 + 2*c*d*tan(f*x +
e) + c^2)/(tan(f*x + e)^2 + 1)) - 2*(2*b*c^4*d - 3*a*c^3*d^2 - 3*b*c^2*d^3 + 3*a*c*d^4 + b*d^5 - 2*(a*c^4*d +
3*b*c^3*d^2 - 3*a*c^2*d^3 - b*c*d^4)*f*x)*tan(f*x + e))/((c^6*d^2 + 3*c^4*d^4 + 3*c^2*d^6 + d^8)*f*tan(f*x + e
)^2 + 2*(c^7*d + 3*c^5*d^3 + 3*c^3*d^5 + c*d^7)*f*tan(f*x + e) + (c^8 + 3*c^6*d^2 + 3*c^4*d^4 + c^2*d^6)*f)

________________________________________________________________________________________

Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: AttributeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))/(c+d*tan(f*x+e))**3,x)

[Out]

Exception raised: AttributeError >> 'NoneType' object has no attribute 'primitive'

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 422 vs. \(2 (179) = 358\).
time = 0.65, size = 422, normalized size = 2.38 \begin {gather*} \frac {\frac {2 \, {\left (a c^{3} + 3 \, b c^{2} d - 3 \, a c d^{2} - b d^{3}\right )} {\left (f x + e\right )}}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac {{\left (b c^{3} - 3 \, a c^{2} d - 3 \, b c d^{2} + a d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} - \frac {2 \, {\left (b c^{3} d - 3 \, a c^{2} d^{2} - 3 \, b c d^{3} + a d^{4}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{6} d + 3 \, c^{4} d^{3} + 3 \, c^{2} d^{5} + d^{7}} + \frac {3 \, b c^{3} d^{2} \tan \left (f x + e\right )^{2} - 9 \, a c^{2} d^{3} \tan \left (f x + e\right )^{2} - 9 \, b c d^{4} \tan \left (f x + e\right )^{2} + 3 \, a d^{5} \tan \left (f x + e\right )^{2} + 8 \, b c^{4} d \tan \left (f x + e\right ) - 22 \, a c^{3} d^{2} \tan \left (f x + e\right ) - 18 \, b c^{2} d^{3} \tan \left (f x + e\right ) + 2 \, a c d^{4} \tan \left (f x + e\right ) - 2 \, b d^{5} \tan \left (f x + e\right ) + 6 \, b c^{5} - 14 \, a c^{4} d - 7 \, b c^{3} d^{2} - 3 \, a c^{2} d^{3} - b c d^{4} - a d^{5}}{{\left (c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}\right )} {\left (d \tan \left (f x + e\right ) + c\right )}^{2}}}{2 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))/(c+d*tan(f*x+e))^3,x, algorithm="giac")

[Out]

1/2*(2*(a*c^3 + 3*b*c^2*d - 3*a*c*d^2 - b*d^3)*(f*x + e)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) + (b*c^3 - 3*a*c^
2*d - 3*b*c*d^2 + a*d^3)*log(tan(f*x + e)^2 + 1)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) - 2*(b*c^3*d - 3*a*c^2*d^
2 - 3*b*c*d^3 + a*d^4)*log(abs(d*tan(f*x + e) + c))/(c^6*d + 3*c^4*d^3 + 3*c^2*d^5 + d^7) + (3*b*c^3*d^2*tan(f
*x + e)^2 - 9*a*c^2*d^3*tan(f*x + e)^2 - 9*b*c*d^4*tan(f*x + e)^2 + 3*a*d^5*tan(f*x + e)^2 + 8*b*c^4*d*tan(f*x
 + e) - 22*a*c^3*d^2*tan(f*x + e) - 18*b*c^2*d^3*tan(f*x + e) + 2*a*c*d^4*tan(f*x + e) - 2*b*d^5*tan(f*x + e)
+ 6*b*c^5 - 14*a*c^4*d - 7*b*c^3*d^2 - 3*a*c^2*d^3 - b*c*d^4 - a*d^5)/((c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6)*(d*
tan(f*x + e) + c)^2))/f

________________________________________________________________________________________

Mupad [B]
time = 5.66, size = 279, normalized size = 1.58 \begin {gather*} \frac {\ln \left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (\frac {3\,a\,d-b\,c}{{\left (c^2+d^2\right )}^2}-\frac {4\,d^2\,\left (a\,d-b\,c\right )}{{\left (c^2+d^2\right )}^3}\right )}{f}-\frac {\frac {-3\,b\,c^3+5\,a\,c^2\,d+b\,c\,d^2+a\,d^3}{2\,\left (c^4+2\,c^2\,d^2+d^4\right )}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (-b\,c^2\,d+2\,a\,c\,d^2+b\,d^3\right )}{c^4+2\,c^2\,d^2+d^4}}{f\,\left (c^2+2\,c\,d\,\mathrm {tan}\left (e+f\,x\right )+d^2\,{\mathrm {tan}\left (e+f\,x\right )}^2\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-b+a\,1{}\mathrm {i}\right )}{2\,f\,\left (-c^3-c^2\,d\,3{}\mathrm {i}+3\,c\,d^2+d^3\,1{}\mathrm {i}\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (a-b\,1{}\mathrm {i}\right )}{2\,f\,\left (-c^3\,1{}\mathrm {i}-3\,c^2\,d+c\,d^2\,3{}\mathrm {i}+d^3\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(e + f*x))/(c + d*tan(e + f*x))^3,x)

[Out]

(log(c + d*tan(e + f*x))*((3*a*d - b*c)/(c^2 + d^2)^2 - (4*d^2*(a*d - b*c))/(c^2 + d^2)^3))/f - ((a*d^3 - 3*b*
c^3 + 5*a*c^2*d + b*c*d^2)/(2*(c^4 + d^4 + 2*c^2*d^2)) + (tan(e + f*x)*(b*d^3 + 2*a*c*d^2 - b*c^2*d))/(c^4 + d
^4 + 2*c^2*d^2))/(f*(c^2 + d^2*tan(e + f*x)^2 + 2*c*d*tan(e + f*x))) + (log(tan(e + f*x) - 1i)*(a*1i - b))/(2*
f*(3*c*d^2 - c^2*d*3i - c^3 + d^3*1i)) + (log(tan(e + f*x) + 1i)*(a - b*1i))/(2*f*(c*d^2*3i - 3*c^2*d - c^3*1i
 + d^3))

________________________________________________________________________________________